package com.zmm.member.submit.vo;

import com.zmm.common.valid.AddGroup;
import com.zmm.common.valid.ListStringValue;
import com.zmm.common.valid.UpdateGroup;
import com.zmm.common.valid.UpdateStatusGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户收货地址
 * @author 900045
 * @description:
 * @name OrderAddressVo
 * @date By 2021-07-23 14:35:28
 */
@Data
public class OrderAddressVo implements Serializable {
	private static final long serialVersionUID = 2223464266423816217L;

	/**
	 * 关联的用户地址ID
	 */
	@NotNull(message = "修改必须指定地址ID",groups ={UpdateGroup.class})
	private Integer addressId;

	/**
	 * 用户ID
	 */
	private Integer customerId;


	/**
	 * 收货人
	 */
	@NotBlank(message = "收货人不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String consigneeName;

	/**
	 * 收件人电话号码
	 */
	private String consigneePhone;

	/**
	 * 收件人手机号码
	 */
	@Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$",message = "手机号格式有误")
	@NotBlank(message = "收件人电话号码不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String consigneeMobile;

	/**
	 * 收件人邮箱
	 */
	private String consigneeEmail;

	/**
	 *   国家ID
	 */
	private Integer countryId;
	
	/**
	 *   国家
	 */
	private String country;

	/**
	 * 省ID
	 */
	@NotNull(message = "省份ID不能为空",groups ={AddGroup.class,UpdateGroup.class})
	private Integer provinceId;

	/**
	 * 省名称
	 */
	private String province;

	/**
	 * 市ID
	 */
	@NotNull(message = "城市ID不能为空",groups ={AddGroup.class,UpdateGroup.class})
	private Integer cityId;

	/**
	 * 市名称
	 */
	private String city;

	/**
	 * 县区ID
	 */
	@NotNull(message = "区县ID不能为空",groups ={AddGroup.class,UpdateGroup.class})
	private Integer countyId;

	/**
	 * 区名称
	 */
	private String county;

	/**
	 * 街道ID
	 */
	@NotNull(message = "街道ID不能为空",groups ={AddGroup.class,UpdateGroup.class})
	private Integer townId;

	/**
	 * 街道名称
	 */
	private String town;

	/**
	 * 收件别名
	 */
	private String consigneeAlias;
	
	/**
	 * 邮编
	 */
	private String consigneePostcode;

	/**
	 * 详细地址
	 */
	private String consigneeDetail;

	/**
	 * 是否默认  0：不默认；1：默认
	 */
	@NotBlank(groups = {AddGroup.class, UpdateStatusGroup.class})
	@ListStringValue(values={"0","1"},message = "请给指定范围的值(0~1)",groups = {AddGroup.class, UpdateStatusGroup.class})
	private String whetherDefault;

	/**
	 * 地址版本号
	 */
	@NotBlank(message = "地址版本号不能为空",groups = {AddGroup.class,UpdateGroup.class})
	private String version;
	
}
